import { viteObfuscateFile  } from 'vite-plugin-obfuscator'

export default function createObfuscator() {
    return viteObfuscateFile ({
      exclude: [/\.(css|less|scss)$/], // 排除样式文件
      compact: true,
      controlFlowFlattening: true,
      deadCodeInjection: true,
      debugProtection: false,
      rotateStringArray: true,
      stringArray: false,
      stringArrayThreshold: 0.75,
      transformObjectKeys: false,
      reservedNames: ['box-card', 'el-header'] // 保留关键变量名
    })
}